<template>
    <div class="box">
        <div class="header">
            <van-nav-bar title="登录" left-arrow @click-left="$router.back()" />
        </div>
        <div class="meddle">
            <van-form @submit="onSubmit">
                <van-cell-group inset>
                    <van-field v-model="username" name="username" label="+86" placeholder="用户名"
                        :rules="[{ required: true, message: '手机号必须是11位' }]" browsing-history-o/>
                        
                    <van-field v-model="password" type="password" name="password" label="密码" placeholder="密码" 
                        :rules="[{ required: true, message: '密码必填' }]" browsing-history-o @click="name=browsing-history-o"></van-field>
                </van-cell-group>
                <div style="margin: 16px;">
                    <van-button round block type="primary" native-type="submit" @click="$router.push('/user')">
                        登录
                    </van-button>
                </div>
                   
                <van-checkbox name="a">复选框 a</van-checkbox>
              
            </van-form>
        </div>
    </div>
</template>
<script setup> 
    import { ref } from "vue";
    const username=ref('')
    const password=ref('')
    import { showSuccessToast, showFailToast } from 'vant';
    const onSubmit=(values)=>{
        if(localstrage.setTimer('token',username.data.values)){
            request.post('/login',{
                params:{
                  
                }
            }).then(res=>{
                if(rea.data.code==200){
                    list.value=res.data.data
                }
            })
        }
    }
</script>